<template>
  <div class="main">
    <el-container class="main-content">
      <el-aside :width="isCollapse ? '60px' : '210px'" class="aside">
        <aside-title :isCollapse="isCollapse" />
        <NavMenu :isCollapse="isCollapse" />
        <!-- <tree-menu :menus="userMenus" /> -->
      </el-aside>
      <el-container class="page">
        <el-header class="page-header">
          <nav-header @isFold="foldClickMenu" />
        </el-header>
        <el-main class="page-content"> <app-main /> </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

import AppMain from '@/components/app-main'
import AsideTitle from '@/components/nav-menu/src/aside-title.vue'
import TreeMenu from '@/components/nav-menu/src/tree-menu.vue'
import NavMenu from '@/components/nav-menu/src/nav-menu.vue'
import NavHeader from '@/components/nav-header'

const isCollapse = ref()
function foldClickMenu(fold: boolean) {
  isCollapse.value = fold
}
</script>

<style lang="less" scoped>
.main {
  width: 100%;
  height: 100%;
  .el-main {
    padding: 10px;
  }
  .main-content,
  .page {
    height: 100%;
  }
  .page-content {
    height: calc(100% - 48px);
  }
  .page-header {
    display: flex;
    color: #333;
    text-align: center;
    align-items: center;
    background-color: #fff;
  }
  .aside {
    background-color: #00162a;
    color: #fff;
  }
  .el-aside {
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 30px;
    text-align: left;
    cursor: pointer;
    background-color: #001529;
    transition: width 0.3s linear;
    scrollbar-width: none; /* firefox */
    -ms-overflow-style: none; /* IE 10+ */

    &::-webkit-scrollbar {
      display: none;
    }
  }
  .el-header {
    height: 48px !important;
  }
  .el-main {
    background-color: #f0f2f5;
  }
}
</style>
